<%@page import="com.system.dao.DoctorDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://com.am.tag" %>
<%
	DoctorDao dao = new DoctorDao();
	Map<String,Object> map = dao.getDiseaseDetails(request.getParameter("record_id"));
	
	pageContext.setAttribute("list", map.get("list"));
	pageContext.setAttribute("personMap", map.get("personMap"));
	pageContext.setAttribute("diagnoseMap", map.get("diagnoseMap"));
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'userEdit.jsp' starting page</title>
    <link rel="stylesheet" href="${path}/css/showtable.css" type="text/css"></link>
    <script type="text/javascript" src="${path}/js/public/grid.js"></script>
	<style type="text/css">
		a:link {
			text-decoration: none;
		}
		
		a:visited {
			text-decoration: none;
		}
		
		a:active {
			text-decoration: none;
		}
		
		a:hover {
			text-decoration: none;
		}
		
		.mywindowTitle {
			font-weight: bold
		}
	</style>
	
  </head>
  <body>
   <form id="winForm" name="winForm">
   		<div  style="padding:10px;width:600;height:500">	
   			<input name="id" type="hidden" value="${param.id}">
	  		<table>
	  			<tr>
					<td valign="top" align="left">
						<font color='#3A5FCD' size='2' style="font-family: '微软雅黑', Verdana, Arial, Helvetica, sans-serif;"><b>基本信息</b></font>
						<hr/>
	  				</td>
				</tr>
				<tr>
					<td valign="top" align="left">
						<div>	
							<table border="0"  height="100%" cellpadding="0" cellspacing="0">
								<tr height="35px">
									<td valign="middle" align="right" width="100px">姓名:</td>
									<td width="120px">
										<input name="name" id="name" class="textbox" value="${personMap['name']}" readonly="readonly" style="width: 120px;color: blue"/>
									</td>
									<td valign="middle" align="right" width="60px">性别:</td>
									<td width="120px">
										<input name="birthday" id="birthday" class="textbox" value="${personMap['sex']}" readonly="readonly" style="width: 120px;color: blue"/>
									</td>
									<td valign="middle" align="right" width="100px">类型:</td>
									<td width="120px">
										<c:choose>
											<c:when test="${personMap['type'] == 0}">
												<input name="birthday" id="birthday" class="textbox" value="学生" readonly="readonly" style="width: 120px;color: blue"/>
											</c:when>
											<c:when test="${personMap['type'] == 1}">
												<input name="birthday" id="birthday" class="textbox" value="教工" readonly="readonly" style="width: 120px;color: blue"/>
											</c:when>
										</c:choose>
									</td>
								</tr>
								<tr height="35px">
									<td valign="middle" align="right" width="100px">联系电话:</td>
									<td width="120px">
										<input name="name" id="name" class="textbox" value="${personMap['telephone']}" readonly="readonly" style="width: 120px;color: blue"/>
									</td>
									<td valign="middle" align="right" width="60px">地址:</td>
									<td width="120px">
										<input name="birthday" id="birthday" class="textbox" value="${personMap['address']}" readonly="readonly" style="width: 120px;color: blue"/>
									</td>
									<td valign="middle" align="right" width="100px">就诊医生:</td>
									<td valign="middle" width="100px">
										<input name="doctor" id="doctor" class="textbox" value="${personMap['user_name']}" readonly="readonly" style="width: 120px;color: blue" />
									</td>
								</tr>
								
								<tr height="35px">
									<td valign="middle" align="right" width="120px">班级/部门:</td>
									<td colspan="5">
										<input name="birthday" id="birthday" class="textbox" value="${personMap['class']}" readonly="readonly" style="width: 200px;color: blue"/>
									</td>
								</tr>
								
								<tr height="35px">
									<td valign="middle" align="right" width="100px">既往病史:</td>
									<td valign="middle" colspan="5" width="500px">
										<input name="birthday" id="birthday" class="textbox" value="${personMap['anamnesis']}" readonly="readonly" style="width: 510px;color: blue" />
									</td>
								</tr>
								<tr height="35px">
									<td valign="middle" align="right" width="100px">症状:</td>
									<td valign="middle" colspan="5">
										<input name="birthday" id="birthday" class="textbox" value="${diagnoseMap['symptom']}" readonly="readonly" style="width: 510px;color: blue" />
									</td>
								</tr>
								<tr height="35px">
									<td valign="top" align="right" width="100px">诊断描述:</td>
									<td valign="middle" colspan="5">
										<textarea rows="5" cols="63" style="color: blue">${diagnoseMap['description'] }</textarea>
									</td>
								</tr>
							</table>
						</div>
	  				</td>
				</tr>
				<tr>
					<td valign="top" align="left">
						<font color='#3A5FCD' size='2' style="font-family: '微软雅黑', Verdana, Arial, Helvetica, sans-serif;"><b>电子处方</b></font>
						<hr/>
	  				</td>
				</tr>
				<tr>
					<td valign="top" align="left">
						<div style="padding-right:10px;padding-left:10px;">	
							<c:if test="${diagnoseMap['post_number'] == null}">
								<table class="showtable" width="100%">
									<tr>
										<th width="10%">序号</th>
										<th width="35%">药品名称</th>
										<th width="10%">数量</th>
										<th width="15%">服用方法</th>
										<th width="15%">次数</th>
										<th width="15%">金额</th>
									</tr>
									<c:forEach items="${list }" var="obj" varStatus="status">
										<tr height="25px">
											<td align="center">${status.count}</td>
											<td>${obj.name }</td>
											<td align="center">${obj.quantity}</td>
											<td align="center">${obj.use_method}</td>
											<td align="center">${obj.times}</td>
											<td align="center">${obj.amount}</td>
										</tr>
									</c:forEach>
								</table>
							</c:if>
							<c:if test="${diagnoseMap['post_number'] != null}">
								<table class="showtable" width="100%">
									<tr>
										<th width="10%">序号</th>
										<th width="35%">药品名称</th>
										<th width="10%">数量</th>
										<th width="15%">服用方法</th>
										<th width="15%">金额</th>
									</tr>
									<c:forEach items="${list }" var="obj" varStatus="status">
										<tr height="25px">
											<td align="center">${status.count}</td>
											<td>${obj.name }</td>
											<td align="center">${obj.quantity}</td>
											<td align="center">${obj.use_method}</td>
											<td align="center">${obj.amount}</td>
										</tr>
									</c:forEach>
								 	<tr height="30px">
								  		<td colspan="8" align="right" style="font-size: 13px;">总共:<input id="post_number" value="${diagnoseMap['post_number']}" type="text" style="border:0;;width:80px;BORDER-RIGHT: medium none;BORDER-TOP: medium none;BORDER-LEFT: medium none;BORDER-BOTTOM:black 1px solid;text-align: center;"/>帖<span style="margin-left: 30px"></span></td>
								  	</tr>
								</table>
							</c:if>
						</div>
	  				</td>
				</tr>
	  		</table>
  		</div>
	</form>
  </body>
</html>
